<template>
  <view>
    <view>
      <u-input v-model="startTime" :border="true" placeholder="请选择开始时间" type="text"
               @click="startShow=!startShow"></u-input>
      <u-input v-model="endTime" :border="true" placeholder="请选择结束时间" type="text"
               @click="endShow=!endShow"></u-input>
    </view>
    <u-picker v-model="startShow" :params="params" mode="time" @confirm="getStartTime">
      开始时间
    </u-picker>
    <u-picker v-model="endShow" :params="params" mode="time" @confirm="getEndTime">结束时间</u-picker>
  </view>
</template>

<script>

import UPicker from "../../uni_modules/vk-uview-ui/components/u-picker/u-picker.vue";
import UButton from "../../uni_modules/vk-uview-ui/components/u-button/u-button.vue";
import UInput from "../../uni_modules/vk-uview-ui/components/u-input/u-input.vue";

export default {
  components: {UInput, UButton, UPicker},
  data() {
    return {
      startShow: false,
      endShow: false,
      params: {
        year: true,
        month: true,
        day: true,
        hour: true,
        minute: true,
        second: true,
        timestamp: true
      },
      startTime: 0,
      endTime: 0
    }
  },
  methods: {
    getStartTime(e) {
      this.startTime = e.timestamp
    },
    getEndTime(e) {
      this.endTime = e.timestamp
    }
  },
  onReady() {
  }
}
</script>

<style>
</style>